#include "PropertyManager.h"

PropertyManager::PropertyManager()
    : editor_(nullptr)
{
}

PropertyManager& PropertyManager::get()
{
    static PropertyManager that;
    return that;
}

PropertyManager& PropertyManager::init(QtTreePropertyBrowser* editor)
{
    PropertyManager::get().editor_ = editor;
    return PropertyManager::get();
}

void PropertyManager::setCurrent(shared_ptr<PropertyProvider> provider)
{
    editor_->clear();
    provider_ = provider;
    provider_->initEditor(editor_);
}
